package demoMod.stsconsole.potions;

import demoMod.stsconsole.core.AbstractCreature;
import demoMod.stsconsole.dungeons.AbstractDungeon;
import demoMod.stsconsole.helpers.DamageInfo;
import demoMod.stsconsole.helpers.PromptHelper;

public class FirePotion extends AbstractPotion {
    public static final String ID = "FirePotion";

    public FirePotion() {
        super(ID);
        this.rarity = PotionRarity.COMMON;
        this.action = UseAction.THROW;
        this.target = Target.ENEMY;
        this.potential = 20;
    }

    @Override
    public String getUpdatedDescription() {
        return String.format(this.description, this.potential);
    }

    @Override
    public void use(AbstractCreature target) {
        if (target != null) {
            target.damage(new DamageInfo(this.potential, AbstractDungeon.player, DamageInfo.DamageType.THORNS));
        }
    }

    @Override
    public boolean canUse() {
        return PromptHelper.getPrompt().contains("Combat");
    }
}
